#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>

int main()
{
    struct timeval tv1, tv2;
    gettimeofday(&tv1, NULL);
    for(int i = 0; i < 100; i++)
        sleep(0.01);
    gettimeofday(&tv2, NULL);
    printf("tv1 data, second:%ld, millisecond:%ld,\n", tv1.tv_sec, tv1.tv_sec * 1000 + tv1.tv_usec / 1000);
    printf("tv1 data, second:%ld, millisecond:%ld,\n", tv2.tv_sec, tv2.tv_sec * 1000 + tv2.tv_usec / 1000);
}
